#include<bits/stdc++.h>
using namespace std;

#define int long long
#define double long double

struct node {
	int x, y;
} vex[105];

double getDistance(node a, node b) {
	double x1 = a.x;
	double x2 = b.x;
	double y1 = a.y;
	double y2 = b.y;

	return sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
}

int n, m, s, t;
double a[105][105];

double dist[105];

void calcDistance() {
	for (int i = 1; i <= 100; i++)	dist[i] = 0xffffffff;
	dist[s] = 0;
	for (int k = 0; k < n; k++) {
		for (int i = 1; i <= n; i++) {
			for (int j = 1; j <= n; j++) {
				if (!a[i][j])	continue;
				dist[j] = min(dist[j], dist[i] + a[i][j]);
			}
		}
	}
}

signed main() {
	cin >> n;
	int x, y;
	for (int i = 1; i <= n; i++) {
		cin >> x >> y;
		vex[i] = {x, y};
	}
	cin >> m;
	for (int i = 1; i <= m; i++) {
		cin >> x >> y;
		a[x][y] = a[y][x] = getDistance(vex[x], vex[y]);
	}
	cin >> s >> t;

	calcDistance();
	cout << fixed << setprecision(2) << (int)(dist[t] * 100) / 100.0;
	return 0;
}
